package com.bjpowernode.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @ClassName MyController
 * @Description 当@RequestMapping中有公共的部分时，可以将公共部分放到类的上边
 * @Author hhwu
 * @Date 2022/3/10 13:04
 * Version 1.0
 **/

@Controller//创建处理器对象，和@Service,@Component一样
@RequestMapping("/user")
public class MyController {
    @RequestMapping("/some.do")
    public ModelAndView doSome(String name, Integer age) {
        /**
         * @Author hhwu
         * @Description //TODO
         * @Date 13:19 2022/3/10
         * @Param []
         * @return org.springframework.web.servlet.ModelAndView
         **/
        //service处理

        ModelAndView mv = new ModelAndView();
        System.out.println("执行mycontroller中的dosome");

        mv.addObject("myname", name);
        mv.addObject("myage", age);

        mv.setViewName("show");

        return mv;
    }

}
